/**
 * cone-service: server.js
 * Description: node 入口程序
 * Time: 2021/5/31 15:46
 */

const Koa = require('koa');
const config = require('./config');
const middleware = require('./middleware');
const router = require('./routers');

const app = new Koa();
middleware(app);
router(app);

app.on('error', function (err, ctx) {
    console.error('server error', err);
});

app.listen(config.port, () => {
    console.log('server is start up on port:' + config.port);
});
